package com.pearadmin.pro.modules.laboratoryManagement.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;
import com.pearadmin.pro.modules.laboratoryManagement.domain.ApplicationRequest;
import com.pearadmin.pro.modules.laboratoryManagement.domain.Applicationtable;
import com.pearadmin.pro.modules.laboratoryManagement.domain.Dangerousroom;
import com.pearadmin.pro.modules.laboratoryManagement.domain.DangerurroomRequest;
import com.pearadmin.pro.modules.laboratoryManagement.repository.ApplicationRepository;
import com.pearadmin.pro.modules.laboratoryManagement.repository.LMRepository;
import com.pearadmin.pro.modules.laboratoryManagement.service.ApplicationService;
import com.pearadmin.pro.modules.laboratoryManagement.service.LMService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class ApplicationServiceImpl extends ServiceImpl<ApplicationRepository, Applicationtable> implements ApplicationService {

    @Resource
    private ApplicationRepository applicationRepository;

    /**
     * 获取物品列表
     *
     * @param request 查询参数
     * @return com.pearadmin.pro.common.web.base.page.PageResponse<com.pearadmin.pro.modules.laboratoryManagement.domain.Dangerousroom>
     * @author ZhouXingYun
     * @date 2022/5/18 11:28
     */
    @Override
    public PageResponse<Applicationtable> page(ApplicationRequest request) {
        return Pageable.of(request,(()-> applicationRepository.page(request)));
    }

    /**
     * 申请使用
     *
     * @param applicationtable
     * @return java.lang.Boolean
     * @author ZhouXingYun
     * @date 2022/5/19 9:27
     */
    @Override
    public Boolean apply(Applicationtable applicationtable) {
        return applicationRepository.apply(applicationtable);
    }
}
